package eco2automotive.tasks;
import eco2automotive.port.ConnectionControl;
/**   
  * Send basic commands to the interface.
  * Wait 3 seconds then describe protocol found.
  * @version 1.0
  * @autor Fco. Javier Sánchez Esparza
  *
  */ 
public class Task_INIT {
       ConnectionControl connControl;  
       
       /**
        * Take the control
        * @param connControl
        */
       public Task_INIT(ConnectionControl connControl){
       this.connControl=connControl;       
           
       }
       /**
        * start
        */
       public void run(){           
        this.connControl.TXData("atz");                                      
        this.connControl.TXData("ATH1"); //HEADERS ON
        this.connControl.TXData("ATSP");  //SET AUTOMATIC
        this.connControl.TXData("0100");
        try{Thread.sleep(3000);}catch(Exception e){}                                            
        this.connControl.TXData("ATDP");        
       }
}
